<?php
class Default_Bootstrap extends Zend_Application_Module_Bootstrap 
{
	protected $_moduleName = 'default';
	
	protected function _initConfiguration()
    {
		$options = $this->getApplication()->getOptions();
		
    	set_include_path(implode(PATH_SEPARATOR, array(
		    realpath(APPLICATION_PATH . '/modules/' . $this->_moduleName . '/models'),
		    get_include_path(),
		)));
		
		return $options;
    }
    
	protected function _initView()
	{
		$view = new Zend_View();
		$view->setEncoding('UTF-8');
		$view->doctype('XHTML1_STRICT');
		$view->headMeta()->appendHttpEquiv('Content-Type', 'text/html;charset=utf-8');
 		$viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper(
 			'ViewRenderer'
 		);
 		$viewRenderer->setView($view);

 		return $view;
	}
	
	protected function _initDatabase()
	{
		$options = $this->getApplication()->getOptions();
        $db = Zend_Db::factory($options['database']['adapter'], $options['database']['params']);
        Zend_Db_Table_Abstract::setDefaultAdapter($db);
        Zend_Registry::set('DB', $db);
        
        return $db;
	}

	
}